package com.bkgy.modular.samePlateDifference.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.samePlateDifference.service.DifferenceService;
import com.bkgy.sys.common.entity.ResultData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @author
 * @version 1.0
 * @ClassName Difference
 * @date 2023/2/16 15:39
 */
@RestController
@RequestMapping("/samePlateDifference")
public class DifferenceController {

    @Resource
    private DifferenceService differenceService;

    @PostMapping("/findDifferenceData")
    public ResultData findDifferenceData(@RequestBody JSONObject jsonObject) {
        return differenceService.findDifferenceData(jsonObject);
    }

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx")
    public void export(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        differenceService.export(jsonObject,response);
    }

    /**
     * 获取曲线
     * @param jsonObject
     * @return
     */
    @PostMapping("/findDifferenceCure")
    public ResultData findDifferenceCure(@RequestBody JSONObject jsonObject) {
        return differenceService.findDifferenceCure(jsonObject);
    }
}
